<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: hardware_ticks</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__hardware__ticks.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">hardware_ticks<div class="ingroups"><a class="el" href="group__hardware.html">Hardware APIs</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Hardware Tick API.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaea457044b65d6af680787206c06faa39"><td class="memItemLeft" align="right" valign="top"><a id="gaea457044b65d6af680787206c06faa39" name="gaea457044b65d6af680787206c06faa39"></a>
typedef enum <a class="el" href="group__hardware__ticks.html#ga7c007d63cabddadd107f9b597278c32e">tick_gen_num_rp2350</a>&#160;</td><td class="memItemRight" valign="bottom"><b>tick_gen_num_t</b></td></tr>
<tr class="memdesc:gaea457044b65d6af680787206c06faa39"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tick generator numbers on RP2350 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>) <br /></td></tr>
<tr class="separator:gaea457044b65d6af680787206c06faa39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd515d04e9260f97a63ed0a1415ef4c2"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="group__hardware__ticks.html#ga567ed42c04aa5b006e234d8a4df38b5a">tick_gen_num_rp2040</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a></td></tr>
<tr class="memdesc:gabd515d04e9260f97a63ed0a1415ef4c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tick generator numbers on RP2040 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>)  <a href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">More...</a><br /></td></tr>
<tr class="separator:gabd515d04e9260f97a63ed0a1415ef4c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga7c007d63cabddadd107f9b597278c32e"><td class="memItemLeft" align="right" valign="top"><a id="ga7c007d63cabddadd107f9b597278c32e" name="ga7c007d63cabddadd107f9b597278c32e"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#ga7c007d63cabddadd107f9b597278c32e">tick_gen_num_rp2350</a> { <br />
&#160;&#160;<b>TICK_PROC0</b> = 0
, <b>TICK_PROC1</b> = 1
, <b>TICK_TIMER0</b> = 2
, <b>TICK_TIMER1</b> = 3
, <br />
&#160;&#160;<b>TICK_WATCHDOG</b> = 4
, <b>TICK_RISCV</b> = 5
, <b>TICK_COUNT</b>
<br />
 }</td></tr>
<tr class="memdesc:ga7c007d63cabddadd107f9b597278c32e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tick generator numbers on RP2350 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>) <br /></td></tr>
<tr class="separator:ga7c007d63cabddadd107f9b597278c32e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga567ed42c04aa5b006e234d8a4df38b5a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#ga567ed42c04aa5b006e234d8a4df38b5a">tick_gen_num_rp2040</a> { <b>TICK_WATCHDOG</b> = 0
, <b>TICK_COUNT</b>
 }</td></tr>
<tr class="memdesc:ga567ed42c04aa5b006e234d8a4df38b5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tick generator numbers on RP2040 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>)  <a href="group__hardware__ticks.html#ga567ed42c04aa5b006e234d8a4df38b5a">More...</a><br /></td></tr>
<tr class="separator:ga567ed42c04aa5b006e234d8a4df38b5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaea97210ea6cb05be8444eef06c10695a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#gaea97210ea6cb05be8444eef06c10695a">tick_start</a> (<a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a> tick, uint cycles)</td></tr>
<tr class="memdesc:gaea97210ea6cb05be8444eef06c10695a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start a tick generator.  <a href="group__hardware__ticks.html#gaea97210ea6cb05be8444eef06c10695a">More...</a><br /></td></tr>
<tr class="separator:gaea97210ea6cb05be8444eef06c10695a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab09f4714958ebacacafc54856a3169df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#gab09f4714958ebacacafc54856a3169df">tick_stop</a> (<a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a> tick)</td></tr>
<tr class="memdesc:gab09f4714958ebacacafc54856a3169df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop a tick generator.  <a href="group__hardware__ticks.html#gab09f4714958ebacacafc54856a3169df">More...</a><br /></td></tr>
<tr class="separator:gab09f4714958ebacacafc54856a3169df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b4d6531a3f9f261dbd4a24883f752b9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__ticks.html#ga2b4d6531a3f9f261dbd4a24883f752b9">tick_is_running</a> (<a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a> tick)</td></tr>
<tr class="memdesc:ga2b4d6531a3f9f261dbd4a24883f752b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if a tick genererator is currently running.  <a href="group__hardware__ticks.html#ga2b4d6531a3f9f261dbd4a24883f752b9">More...</a><br /></td></tr>
<tr class="separator:ga2b4d6531a3f9f261dbd4a24883f752b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >Hardware Tick API. </p>
<p >RP2040 only has one tick generator, and it is part of the watchdog hardware. </p>
<p >The RP2350 has a dedicated Tick block that is used to supply ticks to TIMER0, TIMER1, RISC-V platform timer, Arm Cortex-M33 0 timer, Arm Cortex-M33 1 timer and the WATCHDOG block.  </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="gabd515d04e9260f97a63ed0a1415ef4c2" name="gabd515d04e9260f97a63ed0a1415ef4c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabd515d04e9260f97a63ed0a1415ef4c2">&#9670;&nbsp;</a></span>tick_gen_num_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="group__hardware__ticks.html#ga567ed42c04aa5b006e234d8a4df38b5a">tick_gen_num_rp2040</a> <a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tick generator numbers on RP2040 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>) </p>
<p >RP2040 only has one tick generator, and it is part of the watchdog hardware </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga567ed42c04aa5b006e234d8a4df38b5a" name="ga567ed42c04aa5b006e234d8a4df38b5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga567ed42c04aa5b006e234d8a4df38b5a">&#9670;&nbsp;</a></span>tick_gen_num_rp2040</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__hardware__ticks.html#ga567ed42c04aa5b006e234d8a4df38b5a">tick_gen_num_rp2040</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tick generator numbers on RP2040 (used as typedef <a class="el" href="group__hardware__ticks.html#gabd515d04e9260f97a63ed0a1415ef4c2">tick_gen_num_t</a>) </p>
<p >RP2040 only has one tick generator, and it is part of the watchdog hardware </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2b4d6531a3f9f261dbd4a24883f752b9" name="ga2b4d6531a3f9f261dbd4a24883f752b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b4d6531a3f9f261dbd4a24883f752b9">&#9670;&nbsp;</a></span>tick_is_running()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tick_is_running </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a>&#160;</td>
          <td class="paramname"><em>tick</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if a tick genererator is currently running. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tick</td><td>The tick generator number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the specific ticker is running. </dd></dl>

</div>
</div>
<a id="gaea97210ea6cb05be8444eef06c10695a" name="gaea97210ea6cb05be8444eef06c10695a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaea97210ea6cb05be8444eef06c10695a">&#9670;&nbsp;</a></span>tick_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tick_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a>&#160;</td>
          <td class="paramname"><em>tick</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>cycles</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start a tick generator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tick</td><td>The tick generator number </td></tr>
    <tr><td class="paramname">cycles</td><td>The number of clock cycles per tick </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gab09f4714958ebacacafc54856a3169df" name="gab09f4714958ebacacafc54856a3169df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab09f4714958ebacacafc54856a3169df">&#9670;&nbsp;</a></span>tick_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tick_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__hardware__ticks.html#gaea457044b65d6af680787206c06faa39">tick_gen_num_t</a>&#160;</td>
          <td class="paramname"><em>tick</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stop a tick generator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tick</td><td>The tick generator number </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>